Many different algorithms are known for focusing imaging devices. It would be desirable to have a robust and efficient focusing algorithm specifically adapted for focusing on a flowing liquid sample.